package module.scene.model.dataObj
{
	import module.edittroop.model.dataObj.ArmsConfigObj;
	import module.edittroop.model.dataObj.HeroConfigObj;
	import module.scene.view.iso.TroopIsoObject;

	public class TroopIsoDataObj extends IsoDataObj
	{
		public function TroopIsoDataObj()
		{
		}
		
		public var troopAttack:int;
		
		public var troopDefens:int;
		
		public var troopNum:int;
		
		public var troopSkills:Array;
		
		public var troopName:String;
		
		public var troopId:String;
		
		public var speed:Number;
				
		public var attackRange:int;
		
		public var attackSpeed:int;
		
		public var critRate:Number;
		
		public var heroAttack:int;
		
		public var lucky:int;
		
		public var moveState:int;
		
		public var heroId:String;
		
		public var armsId:String;
		
		
		
		override public function get serverId():String
		{
			return "30001";
		}
		override public function parseDynamicData(data:Object):void
		{
			var info:Object = data;
			absX = info.x;
			absZ = info.y;
			absY = 0;
			direction = info.direction;
			troopId= info.tid.toString();
			troopAttack = info.troopattack;
			troopDefens = info.defence;
			troopName = info.name;
			troopNum = info.num;
			troopSkills = info.skill;
			speed = info.speed;
			attackRange = info.attack_range;
			attackSpeed = info.attck_speed;
			critRate = info.crit_rate;
			heroAttack = info.hero_attck;
			lucky = info.lucky;
			moveState = info.move_state;
			heroId = info.hero_id;
			armsId = info.arms_id;
			userId = data.uid;
		}
    	public static function parseData(data:Object):TroopIsoDataObj
		{
			var $obj:TroopIsoDataObj = new TroopIsoDataObj();
			$obj.absX = data.x;
			$obj.absZ = data.y;
			$obj.absY = 0;
			$obj.direction = data.direction;
			$obj.size = 2;
			$obj.troopAttack = data.troopattack;
			$obj.troopDefens = data.defence;
			$obj.troopName = data.name;
			$obj.troopNum = data.num;
			$obj.troopSkills = data.skill;
			$obj.speed = data.speed;
			$obj.attackRange = data.attack_range;
			$obj.attackSpeed = data.attck_speed;
			$obj.critRate = data.crit_rate;
			$obj.heroAttack = data.hero_attck;
			$obj.lucky = data.lucky;
			$obj.moveState = data.move_state;
			return $obj;
		}
	}
}